package com.zdy.today.activity;

import android.content.Intent;
import android.os.Bundle;

import com.github.jorgecastillo.FillableLoader;
import com.github.jorgecastillo.State;
import com.zdy.today.R;
import com.zdy.today.SvgPath;
import com.zdy.today.base.BaseActivity;

/**
 * Created by jsb-cpyy on 2016/12/13.
 */

public class SplashActivity extends BaseActivity {

    @Override
    protected void init() {
        FillableLoader fillableLoader = (FillableLoader) findViewById(R.id.fillableLoader);
        FillableLoader fillableLoader1 = (FillableLoader) findViewById(R.id.fillableLoader1);
        fillableLoader.setSvgPath(SvgPath.text);
        fillableLoader1.setSvgPath(SvgPath.text1);
        fillableLoader.start();
        fillableLoader1.start();
        fillableLoader.setOnStateChangeListener(state -> {
            switch (state) {
                case State.FINISHED:
                    startActivity(new Intent(SplashActivity.this, MainActivity.class));
                    finish();
                    break;
            }
        });
    }

    @Override
    protected String setTitle() {
        return null;
    }

    @Override
    protected int getResourceId() {
        return 0;
    }

    @Override
    public void initOnCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_splash);
    }

    @Override
    public void onBackPressed() {

    }
}
